import { reactive } from 'vue'
import { getPageList, updateDataStatus } from '@/api/base/product'
import { getOptionList } from '@/api/base/brand'

export function useDetail() {
  const status = reactive({
    saving: false,
    loading: false
  })

  const getDataList = async (data: any) => {
    return getPageList(data)
  }

  const updateDataStatusById = async (userCode: any, status: any) => {
    return updateDataStatus(userCode, status)
  }

  const getBrandOptions = async () => {
    return getOptionList()
  }

  return { status, getDataList, updateDataStatusById, getBrandOptions }
}
